import { defineStore } from 'pinia'
import { ref } from 'vue'

export interface TabbarStyle {
  activeColor: string
  inactiveColor: string
}

export const appStore = defineStore('app', () => {
  const isLoading = ref<boolean>(false)
  const userName = ref<string>('')

  const tabbarStyle: TabbarStyle = {
    activeColor: '#16c2a3',
    inactiveColor: '#AAAAAA'
  }

  const changeIsLoading = (val: boolean) => {
    isLoading.value = val
  }

  const getUserName = (username: string) => {
    userName.value = username
  }

  return {
    changeIsLoading,
    isLoading,
    getUserName,
    tabbarStyle
  }
})
